<?php
/**
 * Nordic Repository
 * 
 * LICENSE
 * 
 * The new BSD license is applied on this source-file. For further
 * information please visit http://license.nordic-dev.de/newbsd.txt
 * or send an email to andre.moelle@gmail.com.
 */

/**
 * Necessary includes.
 */
require_once 'Nordic/Pagebar.php';
require_once 'Nordic/Pagebar/Behaviour.php';

/**
 * This behaviour checks whether the page is the page before the active page.
 * 
 * @category   Nordic
 * @package    Nordic_Pagebar
 * @copyright  2007 Nordic Development
 * @license    http://license.nordic-dev.de/newbsd.txt (New-BSD license)
 * @author     Andre Moelle <andre.moelle@gmail.com>
 * @version    $Id: Previous.php 3 2007-07-08 09:21:42Z andre.moelle $
 */
class Nordic_Pagebar_Behaviour_Previous extends Nordic_Pagebar_Behaviour
{
	/**
	 * @see Nordic_Pagebar_Behaviour::_applies()
	 */
	protected function _applies (Nordic_Pagebar $pagebar, $page)
	{
		return ($pagebar->getPage() - 1 == $page);
	}
	
	/**
	 * @see Nordic_Pagebar_Behaviour::getAlias()
	 */
	public function getAlias ()
	{
		return 'Previous';
	}
}
?>